define(['backbone', 'underscore', 'jsonview', 'jquery'], function(Backbone, _, jsonview, $) {

  function main() {
    require(['hy5b/frontend/canvas/index'
      , 'hy5b/frontend/crosshair/index'
      , 'html!v/graph-canvas/transform/tmpl/index.html'
      , 'css!v/graph-canvas/transform/css/style.css'], app);
  }

  function app(canvas, crosshair, tmpl) {
    //crosshair()

    var $app = $('<div id="app">')
    $('#main').html($app);

    $app.append('<canvas width="800" height="600" id="canvas" class="mesh">')
    $app.append($(tmpl).val("Hello I'm text"))

    var canvas = document.getElementById("canvas");
    var ctx = canvas.getContext("2d");

    // ctx.setTransform(4, 0, 0, 4, 10, 10);
    $(canvas).drawText({
      fillStyle: '#9cf',
      strokeStyle: '#25a',
      strokeWidth: 2,
      x: 0,
      y: 100,
      font: '24px Verdana, sans-serif',
      text: 'Hello'
    })
  }

  return main;
})
